package com.example.lib_common.base.state

sealed class RequestEvent

object Success  : RequestEvent()
class Failed(val message:String) : RequestEvent()
object Loading : RequestEvent()
object Empty : RequestEvent()
fun RequestEvent.toUIStatus(): UIState? {
    return when (this) {
        is Loading -> UIState.LOADING
        is Success -> UIState.SUCCESS
        is Empty -> UIState.EMPTY
        is Failed -> UIState.NETWORK_ERROR
        else -> null
    }
}